package xyz.ddlnt.servicemgclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.dto.TechnologyDTO;
import xyz.ddlnt.model.vo.TechnologyInfoVO;
import xyz.ddlnt.model.vo.TechnologySelectVO;
import xyz.ddlnt.model.vo.TechnologyVO;
import xyz.ddlnt.servicemgclient.client.fallback.TechnologyFallbackFactory;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/1 22:33
 */
//@FeignClient(name = "service-mg", url = "http://yixuewang-service-mg:9016", path = "/technology", fallbackFactory = TechnologyFallbackFactory.class)
//@FeignClient(name = "service-mg", url = "http://localhost:9006", path = "/technology", fallbackFactory = TechnologyFallbackFactory.class)
@FeignClient(value = "service-mg", path = "/technology", fallbackFactory = TechnologyFallbackFactory.class)
public interface TechnologyFeignClient {

    /**
     * 查询所有类别科目的基本信息
     * @return
     */
    @GetMapping("/selectTechCategoryInfos")
    Result<List<TechnologySelectVO>> selectTechCategoryInfos();

    /**
     * 查询所有科目信息
     * @return
     */
    @GetMapping("/selectAll")
    Result<List<TechnologyVO>> selectAll();

    /**
     * 根据类别id查询类别下所有科目信息
     * @param categoryId
     * @return
     */
    @GetMapping("/selectByCategoryId")
    Result<List<TechnologyInfoVO>> selectByCategoryId(@RequestParam Long categoryId);

    /**
     * 根据科目id查询科目信息
     * @param technologyId
     * @return
     */
    @GetMapping("/selectByTechnologyId")
    Result<TechnologyInfoVO> selectByTechnologyId(@RequestParam Long technologyId);

    /**
     * 添加科目信息
     * @param technologyDTO
     * @return
     */
    @PostMapping("/add")
    Result<TechnologyVO> addTechnology(@RequestBody TechnologyDTO technologyDTO);

    /**
     * 修改科目信息
     * @param technologyDTO
     * @return
     */
    @PutMapping("/update")
    Result<LocalDateTime> updateTechnology(@RequestBody TechnologyDTO technologyDTO);

    /**
     * 删除科目信息
     * @param technologyId
     * @return
     */
    @DeleteMapping("/delete")
    Result<Boolean> deleteTechnology(@RequestParam Long technologyId);
}
